<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"                
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/templates/layout.xhtml">

<ui:define name="content" >

	<h:dataTable value="#{mbVenda.listDeVenda()}" var="v">
		<f:facet name="header">Lista de Vendas</f:facet>

		<h:column>
			<f:facet name="header">Data Venda</f:facet>
				<h:outputText value="#{v.dataVenda.toDate()}" >
				<f:convertDateTime type="date" pattern="dd/MM/yyyy" dateStyle="short"/>
				</h:outputText>
			</h:column>
			
		<h:column>
			<f:facet name="header">Descrição</f:facet>
				#{v.produto.descricao}
			</h:column>
			
		<h:column>
			<f:facet name="header">Quantidade</f:facet>
				#{v.qtd}
			</h:column>
			
		<h:column>
			<f:facet name="header">Preço Unit</f:facet>
				#{v.precoUnit}
			</h:column>


		<h:column>
			<f:facet name="header">Valor Total</f:facet>
				#{v.total}
			</h:column>

	</h:dataTable>
</ui:define>

</ui:composition>